Operating System Concepts by unknow
Author:unknow
Language: eng
Format: epub
Published: 0101-01-01T00:00:00+00:00
12.6.2. Swap-Space Location
A swap space can reside in one of two places: It can be carved out of the normal file system, or it can be in a separate disk partition. If the swap space is simply a large file within the file system, normal file-system routines can be used to create it, name it, and allocate its space. This approach, though easy to implement, is inefficient. Navigating the directory structure and the disk-allocation data structures takes time and (potentially) extra disk accesses. External fragmentation can greatly increase swapping times by forcing multiple seeks during reading or writing of a process image. We can improve performance by caching the block location information in physical memory and by using special tools to allocate physically contiguous blocks for the swap file, but the cost of traversing the file-system data structures still remains.
Alternatively, swap space can be created in a separate raw partition, as no file system or directory structure is placed in this space. Rather, a separate swap-space storage manager is used to allocate and deallocate the blocks from the raw partition. This manager uses algorithms optimized for speed rather than for storage efficiency, because swap space is accessed much more frequently than file systems (when it is used). Internal fragmentation may increase, but this trade-off is acceptable because the life of data in the swap space generally is much shorter than that of files in the file system. Swap space is reinitialized at boot time so any fragmentation is short-lived. This approach creates a fixed amount of swap space during disk partitioning. Adding more swap space requires repartitioning the disk (which involves moving the other file-system partitions or destroying them and restoring them from backup) or adding another swap space elsewhere.
Some operating systems are flexible and can swap both in raw partitions and in file-system space. Linux is an example: The policy and implementation are separate, allowing the machine's administrator to decide which type of swapping to use. The trade-off is between the convenience of allocation and management in the file system and the performance of swapping in raw partitions.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(25279)
Hello! Python by Anthony Briggs(24320)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(23417)
Kotlin in Action by Dmitry Jemerov(22500)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(21952)
Dependency Injection in .NET by Mark Seemann(21834)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(20696)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(19513)
Grails in Action by Glen Smith Peter Ledbrook(18591)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(17028)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(15836)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(13683)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11844)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(11149)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10619)
Hit Refresh by Satya Nadella(9185)
The Kubernetes Operator Framework Book by Michael Dame(8560)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8398)
Robo-Advisor with Python by Aki Ranin(8344)